home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 493.lha / SmallIFFParseLibrary / sources / handleiff.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-06  |  1.8 KB  |  61 lines

  1. #include <iff/iffparse.h>
  2.  
  3. typedef struct {
  4.     unsigned Complex : 1;
  5.     unsigned Size    : 15;
  6. } chunk;
  7.  
  8. struct IFF {
  9.     ULONG   iff_Stream;
  10.     ULONG   iff_Flags;
  11.     ULONG   iff_Depth;
  12.     chunk   *iff_Stack;
  13.     short   iff_Type;
  14.     struct ContextNode current;
  15. };
  16.  
  17. struct CBHandle {
  18.     struct IOClipReq    *cbh_Req;
  19.     struct MsgPort        *cbh_CBport;
  20.     struct MsgPort        *cbh_SatisfyPort;
  21. };
  22. #define TraceCall  KPutStr(__FUNC__"\n")
  23. #define DoClipIO(req)   DoIO((struct IORequest *)req)
  24. #define IOReq(iff)      ((struct CBHandle *)iff->iff_Stream)->cbh_Req
  25. #define File(iff)       (BPTR)((struct FileHandle *)iff->iff_Stream)
  26. #define IFFStack        iff->iff_Stack
  27. #define IFFScan         iff->iff_Scan
  28. #define IFFptr          iff->iff_Depth
  29.  
  30. #define FILEHANDLE 0x01
  31. #define IOREQUEST  0x02
  32.  
  33. void *NULL_NOOP();
  34. long NOOP();
  35. long GoodID();
  36. long GoodType();
  37. UBYTE *IDtoStr(long ID, UBYTE *Buf);
  38. long InitIFFasClip(struct IFF *iff);
  39. long InitIFFasDOS(struct IFF *iff);
  40. long OpenIFF(struct IFF *iff, long rwmode);
  41. void CloseIFF(struct IFF *iff);
  42. struct IFF *AllocIFF(void);
  43. void FreeIFF(struct IFF *iff);
  44. struct CBHandle *OpenClipboard(long unit);
  45. void CloseClipboard(struct CBHandle *ch);
  46. long WriteChunkBytes(struct IFF *iff, APTR data, long size);
  47. long ReadChunkBytes(struct IFF *iff, APTR data, size_t datasize);
  48. long AllocReadChunkBytes(struct IFF *iff, APTR data, size_t datasize);
  49. long EnterNextChunk(struct IFF *iff, struct ContextNode *cn);
  50. long PushChunk(struct IFF *iff, long id, long type, long size);
  51. long EnterChunk(struct IFF *iff, long id,long type);
  52. long PopChunk(struct IFF *iff);
  53. long ExitChunk(struct IFF *iff);
  54. long SkipChunk(struct IFF *iff);
  55. long ParseIFF(struct IFF *iff, long control);
  56. struct ContextNode *CurrentChunk(struct IFF *iff);
  57. #define WriteChunkData(iff, data, size) WriteChunkBytes(iff, (APTR)data, (long)size)
  58.  
  59. #define SUCCESS 0L
  60. #define FAILED  -1L
  61.